package unipampa.extensions.games.pampaPife;

import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.smartfoxserver.v2.extensions.BaseClientRequestHandler;

public class TratarCompraDoMonte extends BaseClientRequestHandler{

	public void handleClientRequest(User usuario, ISFSObject params){
		PampaPifeExtension gameExt = (PampaPifeExtension) getParentExtension();
		Carta c = gameExt.baralho.compraCarta(usuario.getId());
		SFSObject respObj = new SFSObject();
		
		respObj.putInt("valor", c.getValor());
		respObj.putInt("naipe", c.getNaipe());
		respObj.putInt("baralho", c.getBaralho());
		trace("Enviando carta do monte.");
		send("cartaDoMonte", respObj, usuario );
	}
}
